class Generic g where
  unit :: g Unit
  plus :: (Rep α, Rep β ) ⇒ g (Plus α β )

class Rep α where 
  rep :: (Generic g ) ⇒ g α 

instance Rep Unit where 
  rep = unit 

instance (Rep α, Rep β ) ⇒ Rep (Plus α β ) where 
  rep = plus 

instance Generic ShowBin where 
  unit = ShowBin (λx → [ ]) 
  plus = ShowBin (λx → case x of Inl l → 0 : showBin l 
                                 Inr r → 1 : showBin r ) 

showBin :: (Rep α) ⇒ α → Bin 
showBin = appShowBin rep
